package com.minimalist.common.entity.lindi.vo.tradeapplication;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.config.swagger.SchemaEnum;
import com.minimalist.common.entity.lindi.enums.LindiTradeApplicationEnum;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;


import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author 11987
 */

@Schema(name = "林地指标平台_交易指标申请同意实体")
public class LindiTradeApplicationAgreeVO implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(name = "tradeApplicationId", description = "交易指标申请ID", type = "string")
    private Long tradeApplicationId;

    @NotNull(message = "是否同意不能为空", groups = {Add.class, Update.class})
    @SchemaEnum(implementation = LindiTradeApplicationEnum.AgreeEnum.class)
    @Schema(name = "agree", description = "是否同意", type = "string")
    private Integer agree;

    @Schema(name = "agree", description = "拒绝原因", type = "string")
    private String refuseReason;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "createId", description = "更新人ID", type = "string")
    private Long updateId;

    @Schema(name = "updateTime", description = "更新时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime updateTime;

    @Schema(name = "confirmLetterTemplateId", description = "确认函模板ID", type = "string")
    private Long confirmLetterTemplateId;

    @Schema(name = "confirmLetterType", description = "确认函类型", type = "string")
    private String confirmLetterType;

    @Schema(name = "tradeCodeType", description = "交易编号生成方式：auto-自动生成，manual-手动输入", type = "string")
    private String tradeCodeType;

    @Schema(name = "tradeCode", description = "手动输入的交易编号", type = "string")
    private String tradeCode;

    @Schema(name = "contractTemplateId", description = "合同模板ID", type = "string")
    private Long contractTemplateId;

    @Schema(name = "contractType", description = "合同类型", type = "string")
    private String contractType;

    private Long tenantId;

    public LindiTradeApplicationAgreeVO() {
    }

    public LindiTradeApplicationAgreeVO(Long tradeApplicationId, Integer agree, String refuseReason, Long updateId, LocalDateTime updateTime, Long confirmLetterTemplateId, String confirmLetterType, String tradeCodeType, String tradeCode, Long contractTemplateId, String contractType, Long tenantId) {
        this.tradeApplicationId = tradeApplicationId;
        this.agree = agree;
        this.refuseReason = refuseReason;
        this.updateId = updateId;
        this.updateTime = updateTime;
        this.confirmLetterTemplateId = confirmLetterTemplateId;
        this.confirmLetterType = confirmLetterType;
        this.tradeCodeType = tradeCodeType;
        this.tradeCode = tradeCode;
        this.contractTemplateId = contractTemplateId;
        this.contractType = contractType;
        this.tenantId = tenantId;
    }

    public Long getTradeApplicationId() {
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId) {
        this.tradeApplicationId = tradeApplicationId;
    }

    public Integer getAgree() {
        return agree;
    }

    public void setAgree(Integer agree) {
        this.agree = agree;
    }

    public String getRefuseReason() {
        return refuseReason;
    }

    public void setRefuseReason(String refuseReason) {
        this.refuseReason = refuseReason;
    }

    public Long getUpdateId() {
        return updateId;
    }

    public void setUpdateId(Long updateId) {
        this.updateId = updateId;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public Long getConfirmLetterTemplateId() {
        return confirmLetterTemplateId;
    }

    public void setConfirmLetterTemplateId(Long confirmLetterTemplateId) {
        this.confirmLetterTemplateId = confirmLetterTemplateId;
    }

    public String getConfirmLetterType() {
        return confirmLetterType;
    }

    public void setConfirmLetterType(String confirmLetterType) {
        this.confirmLetterType = confirmLetterType;
    }

    public String getTradeCodeType() {
        return tradeCodeType;
    }

    public void setTradeCodeType(String tradeCodeType) {
        this.tradeCodeType = tradeCodeType;
    }

    public String getTradeCode() {
        return tradeCode;
    }

    public void setTradeCode(String tradeCode) {
        this.tradeCode = tradeCode;
    }

    public Long getContractTemplateId() {
        return contractTemplateId;
    }

    public void setContractTemplateId(Long contractTemplateId) {
        this.contractTemplateId = contractTemplateId;
    }

    public String getContractType() {
        return contractType;
    }

    public void setContractType(String contractType) {
        this.contractType = contractType;
    }

    public Long getTenantId() {
        return tenantId;
    }

    public void setTenantId(Long tenantId) {
        this.tenantId = tenantId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        LindiTradeApplicationAgreeVO that = (LindiTradeApplicationAgreeVO) o;

        if (tradeApplicationId != null ? !tradeApplicationId.equals(that.tradeApplicationId) : that.tradeApplicationId != null) return false;
        if (agree != null ? !agree.equals(that.agree) : that.agree != null) return false;
        if (refuseReason != null ? !refuseReason.equals(that.refuseReason) : that.refuseReason != null) return false;
        if (updateId != null ? !updateId.equals(that.updateId) : that.updateId != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;
        if (confirmLetterTemplateId != null ? !confirmLetterTemplateId.equals(that.confirmLetterTemplateId) : that.confirmLetterTemplateId != null) return false;
        if (confirmLetterType != null ? !confirmLetterType.equals(that.confirmLetterType) : that.confirmLetterType != null) return false;
        if (tradeCodeType != null ? !tradeCodeType.equals(that.tradeCodeType) : that.tradeCodeType != null) return false;
        if (tradeCode != null ? !tradeCode.equals(that.tradeCode) : that.tradeCode != null) return false;
        if (contractTemplateId != null ? !contractTemplateId.equals(that.contractTemplateId) : that.contractTemplateId != null) return false;
        if (contractType != null ? !contractType.equals(that.contractType) : that.contractType != null) return false;
        return tenantId != null ? tenantId.equals(that.tenantId) : that.tenantId == null;
    }

    @Override
    public int hashCode() {
        int result = tradeApplicationId != null ? tradeApplicationId.hashCode() : 0;
        result = 31 * result + (agree != null ? agree.hashCode() : 0);
        result = 31 * result + (refuseReason != null ? refuseReason.hashCode() : 0);
        result = 31 * result + (updateId != null ? updateId.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (confirmLetterTemplateId != null ? confirmLetterTemplateId.hashCode() : 0);
        result = 31 * result + (confirmLetterType != null ? confirmLetterType.hashCode() : 0);
        result = 31 * result + (tradeCodeType != null ? tradeCodeType.hashCode() : 0);
        result = 31 * result + (tradeCode != null ? tradeCode.hashCode() : 0);
        result = 31 * result + (contractTemplateId != null ? contractTemplateId.hashCode() : 0);
        result = 31 * result + (contractType != null ? contractType.hashCode() : 0);
        result = 31 * result + (tenantId != null ? tenantId.hashCode() : 0);
        return result;
    }

    public static LindiTradeApplicationAgreeVOBuilder builder() {
        return new LindiTradeApplicationAgreeVOBuilder();
    }

    public static class LindiTradeApplicationAgreeVOBuilder {
        private Long tradeApplicationId;
        private Integer agree;
        private String refuseReason;
        private Long updateId;
        private LocalDateTime updateTime;
        private Long confirmLetterTemplateId;
        private String confirmLetterType;
        private String tradeCodeType;
        private String tradeCode;
        private Long contractTemplateId;
        private String contractType;
        private Long tenantId;

        LindiTradeApplicationAgreeVOBuilder() {
        }

        public LindiTradeApplicationAgreeVOBuilder tradeApplicationId(Long tradeApplicationId) {
            this.tradeApplicationId = tradeApplicationId;
            return this;
        }

        public LindiTradeApplicationAgreeVOBuilder agree(Integer agree) {
            this.agree = agree;
            return this;
        }

        public LindiTradeApplicationAgreeVOBuilder refuseReason(String refuseReason) {
            this.refuseReason = refuseReason;
            return this;
        }

        public LindiTradeApplicationAgreeVOBuilder updateId(Long updateId) {
            this.updateId = updateId;
            return this;
        }

        public LindiTradeApplicationAgreeVOBuilder updateTime(LocalDateTime updateTime) {
            this.updateTime = updateTime;
            return this;
        }

        public LindiTradeApplicationAgreeVOBuilder confirmLetterTemplateId(Long confirmLetterTemplateId) {
            this.confirmLetterTemplateId = confirmLetterTemplateId;
            return this;
        }

        public LindiTradeApplicationAgreeVOBuilder confirmLetterType(String confirmLetterType) {
            this.confirmLetterType = confirmLetterType;
            return this;
        }

        public LindiTradeApplicationAgreeVOBuilder tradeCodeType(String tradeCodeType) {
            this.tradeCodeType = tradeCodeType;
            return this;
        }

        public LindiTradeApplicationAgreeVOBuilder tradeCode(String tradeCode) {
            this.tradeCode = tradeCode;
            return this;
        }

        public LindiTradeApplicationAgreeVOBuilder contractTemplateId(Long contractTemplateId) {
            this.contractTemplateId = contractTemplateId;
            return this;
        }

        public LindiTradeApplicationAgreeVOBuilder contractType(String contractType) {
            this.contractType = contractType;
            return this;
        }

        public LindiTradeApplicationAgreeVOBuilder tenantId(Long tenantId) {
            this.tenantId = tenantId;
            return this;
        }

        public LindiTradeApplicationAgreeVO build() {
            return new LindiTradeApplicationAgreeVO(tradeApplicationId, agree, refuseReason, updateId, updateTime, confirmLetterTemplateId, confirmLetterType, tradeCodeType, tradeCode, contractTemplateId, contractType, tenantId);
        }

        public String toString() {
            return "LindiTradeApplicationAgreeVO.LindiTradeApplicationAgreeVOBuilder(tradeApplicationId=" + this.tradeApplicationId + ", agree=" + this.agree + ", refuseReason=" + this.refuseReason + ", updateId=" + this.updateId + ", updateTime=" + this.updateTime + ", confirmLetterTemplateId=" + this.confirmLetterTemplateId + ", confirmLetterType=" + this.confirmLetterType + ", tradeCodeType=" + this.tradeCodeType + ", tradeCode=" + this.tradeCode + ", contractTemplateId=" + this.contractTemplateId + ", contractType=" + this.contractType + ", tenantId=" + this.tenantId + ")";
        }
    }
}
